package _8_visitor

import "fmt"

type Visitor interface {
	visit(interface{})
}

type Visitor1 struct {
}

func (v Visitor1) visit(i interface{}) {
	fmt.Println("Visitor1 visit data")
}

type Visitor2 struct {
}

func (v Visitor2) visit(i interface{}) {
	fmt.Println("Visitor2 visit data")
}

type DataBeVisitor struct {
	data []string
}

func (receiver DataBeVisitor) Visit(visitor Visitor) {
	visitor.visit(receiver.data)
}
